package com.tledu.production.service.crafts.impl;

import com.tledu.production.core.exception.CustomException;
import com.tledu.production.mapper.crafts.TechnologyMapper;
import com.tledu.production.model.crafts.TechnologyModel;
import com.tledu.production.model.system.SysUser;
import com.tledu.production.service.crafts.ITechnologyService;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
@AllArgsConstructor
public class TechnologyServiceImpl implements ITechnologyService {
    final private TechnologyMapper technologyMapper;
    @Override
    public List<TechnologyModel> list() {
        return technologyMapper.list();
    }

    @Override
    public List<TechnologyModel> selectByName(String condition, String conditionName) {
        List<TechnologyModel> list = technologyMapper.selectByName(condition,conditionName);
        if (list == null) {
            throw new CustomException("用户列表为空");
        }

        return list;
    }


    @Override
    public Integer add(TechnologyModel technologyModel) {
        return technologyMapper.add(technologyModel);
    }

    @Override
    public Integer edit(TechnologyModel technologyModel) {
        return technologyMapper.edit(technologyModel);
    }

    @Override
    public Integer deleteByName(String technologyId) {
        return technologyMapper.deleteByName(technologyId);
    }

    @Override
    public Integer[] del(List<String> technologyId) {
        return new Integer[0];
    }

    @Override
    public TechnologyModel findById(String technologyId) {
        return technologyMapper.findById(technologyId);
    }

    @Override
    public List<TechnologyModel> cloud() {
        return technologyMapper.cloud();
    }


}
